package one.stand;

import com.jmp.autocofiguration.JmpProperties;
import com.jmp.autocofiguration.SwaggerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author Administrator
 */
@Configuration
public class SwaggerConfiguration extends SwaggerConfig {
    @Autowired
    private JmpProperties jmpProperties;

    @Bean
    public Docket home() {
        return createRestApi("one.stand.controller.home", "登录");
    }

    @Bean
    public Docket index() {
        return createRestApi("one.stand.controller.index", "首页");
    }

    @Bean
    public Docket supplier() {
        return createRestApi("one.stand.controller.supplier", "店铺");
    }

    @Bean
    public Docket category() {
        return createRestApi("one.stand.controller.category", "分类");
    }

    @Bean
    public Docket order() {
        return createRestApi("one.stand.controller.order", "订单");
    }

    protected ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("CrmApp API")
                .description("花园购原生系统接口文档")
                .version(jmpProperties.getVersion())
                .contact(new Contact("东阳全景网络科技有限公司", "", ""))
                .build();
    }
}
